/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package hangmangame;

/**
 *
 * @author Joana
 */
public class AbstractHangManView {
    
    
    protected HangManGame game;
    
    public String drawText() {
        String line = "";
        int num_under_lines = game.getWord().length();
        if (num_under_lines > 0) {
            for (int i = 0; i < num_under_lines; i++) {
                if (game.checkCharacter(game.getGuessedCharacters(), game.getWord().charAt(i))) {
                    line += game.getWord().charAt(i) + " ";
                } else {
                    line += "_ ";
                }
            }
        }
        return line;
    }
    
    public void newGame() {
        game.newGame();
    }
    
}
